<?php
namespace Core\Config;


class PhpSettingsPostprocessor implements IPostprocessor {
	
	public function execute() {
		if (!is_null($this->errorHandler)) {
			set_error_handler($this->errorHandler);
		}
		
		if (!is_null($this->exceptionHandler)) {
			set_exception_handler($this->exceptionHandler);
		}
		
		foreach($this->settings as $key => $value) {
			ini_set($key, $value);
		}
	}	
	
	// DATA
	private $settings;
	private $errorHandler;
	private $exceptionHandler;

	public function setSettings($settings) {
		$this->settings = $settings;
	}
	
	public function setErrorHandler($errorHandler) {
		$this->errorHandler = $errorHandler;
	}
	
	public function setExceptionHandler($exceptionHandler) {
		$this->exceptionHandler = $exceptionHandler;
	}
}